<template>
  <div style="height:100%;width:100%">

    <!-- <home-bar></home-bar> -->
    <div class="mainContent el-row">

      <el-dialog title="选择操作人" :visible.sync="operateVisible" :show-close="false" :close-on-click-modal="false" width="30%" class="checkradioClass">
        <el-radio-group v-model="operate" v-for="item in operateList" :key='item.name'>
          <el-radio :label="item.id" item border style="margin-right:10px;margin-bottom:10px;" @change="cookit(item)">{{item.name}}</el-radio>
        </el-radio-group>
        <div slot="footer" class="dialog-footer">
          <el-button type="warning" @click.native="logout">退出</el-button>
          <el-button type="primary" @click.native="operateSubmit">确 定</el-button>
        </div>
      </el-dialog>

    </div>
    <!-- <snow></snow> -->
  </div>
</template>

<script>
export default {
  data() {
    return {
      expireCount: 0,
      feeFailCount: 0,
      settleCount: 0,
      isFaTimed: true,
      isYwKouXi: true,
      isFaSettle: true,
      selected: ['110000', '110100', '110101'],

      isoperate: false,
      operateVisible: false,
      operateList: {},
      operate: {},
      operateDetali:'',
    };
  },

  created() {
    let selectOoperate = JSON.parse(window.sessionStorage.getItem('selectOoperate'))
    let isShow = window.sessionStorage.getItem('isSelect');
    if (selectOoperate != null) {
      this.operateList = selectOoperate;
      if (selectOoperate.length > 1 && isShow == null) {
        this.operate = selectOoperate[0].id;
        this.operateDetali=selectOoperate[0];
        this.operateVisible = true;
      }else{
         
              window.sessionStorage.setItem('isSelect', true);
              window.sessionStorage.setItem('operateDetali', JSON.stringify(selectOoperate[0]));
         
      }
    }
  },
  methods: {
    cookit(m){
        this.operateDetali=m;
    },
    operateSubmit() {
      // console.log( this.operate)
      this.$http('/bport/chooseEmployee', { data: { employeeId: this.operate } }).then(resp => {
        if (resp.code == 1) {
          this.operateVisible = false
          window.sessionStorage.setItem('isSelect', true);
           window.sessionStorage.setItem('operateDetali',  JSON.stringify(this.operateDetali));
          this.$message({
            message: resp.msg,
            type: "success"
          });
        }
      })

    },
    logout: function() {
      var _this = this;
      this.$confirm("确认退出吗?", "提示", {})
        .then(() => {
          this.$http('/logOutAccount').then(resp => {
            if (resp.code == 1) {

              _this.$router.push("/login");
              window.sessionStorage.clear();
            }
          })
        })
        .catch(() => { });
    },
  }


};
</script>

<style scoped>
.box-card:hover {
  cursor: pointer;
}

div.el-dialog__body {
  text-align: left;
}

.jijiang {
  background-color: rgba(230, 162, 60, .1);
  border-color: rgba(230, 162, 60, .2);
  color: #e6a23c;
}

.shibai {
  background-color: hsla(0, 87%, 69%, .1);
  border-color: hsla(0, 87%, 69%, .2);
  color: #f56c6c;
}

.shenqing {
  background-color: rgba(87, 193, 35, 0.1);
  border-color: rgba(103, 194, 58, .2);
  color: #67c23a;
}

.area-select {
  font-size: 1rem;
  height: 3rem;
  line-height: 3rem;
  padding-left: 10px;
  box-sizing: border-box;
  border: 1px solid #409eff;
}
</style>


